package com.guigu.ssyx.sys.controller;


import com.atguigu.ssyx.model.sys.Region;
import com.guigu.ssyx.common.result.Result;
import com.guigu.ssyx.sys.service.RegionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/admin/sys/region")
public class RegionController {

    @Autowired
    private RegionService regionService;


    @GetMapping("findRegionByKeyword/{keyword}")
    public Result findRegionByKeyword(@PathVariable String keyword) {
       List<Region> list =  regionService.findRegionByKeyword(keyword);
       return Result.ok(list);
    }
}
